﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace TestPasswordGen
{
    class Program
    {
        static void Main(string[] args)
        {
            int MIN_LENGTH = 6;
            int MAX_LENGTH = 100;
            char[] PASSWORD_CHARSET = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray();

            byte[] randomBytes = new byte[MAX_LENGTH];
            RandomNumberGenerator rng = RNGCryptoServiceProvider.Create();
            rng.GetBytes(randomBytes);


            decimal prob;
            int result;

            using (System.IO.StreamWriter sw = new System.IO.StreamWriter("C:\\temp\\result.csv"))
            {
                sw.AutoFlush = true;

                for (int i = 0; i < MAX_LENGTH; i++)
                {
                    result = (int)(((decimal)randomBytes[i] / byte.MaxValue) * 6);
                    sw.WriteLine(result);
                    Console.WriteLine("Result {0}: {1}", i, result);
                }
            }
            
            Console.ReadLine();
            
        }
    }
}
